package com.bana.sys.model;

import com.bana.sys.utils.Convert;

import java.util.ArrayList;
import java.util.List;

/**
 * 用户
 */
public class User {

    //数据库字段
    private String yhmc;
    private String dlmm;
    private int rybm;
    private int jgbm;

    //基本信息
    private String token;
    private String xm;
    private String sj;
    private String jgmc;
    private String oldDlmm;
    private String departmentPath;
    private List<Role> roles;
    private List<Function> functions;
    public String getRolessm() {

        if(this.roles==null||this.roles.isEmpty())
        {
            return null;
        }
        else
        {
            List<String> list=new ArrayList<>();
            for(Role role:this.roles)
            {
                list.add(role.getJsmc());
            }
            return Convert.toString(list);
        }
    }

    public void setYhmc(String yhmc) {
        this.yhmc = yhmc;
    }

    public void setRybm(int rybm){this.rybm = rybm;}

    public String getYhmc() {
        return yhmc;
    }

    public int getRybm() {
        return rybm;
    }

    public void setDlmm(String dlmm) {
        this.dlmm = dlmm;
    }
    public String getDlmm() {
        return dlmm;
    }

    public String getJgmc() {
        return jgmc;
    }

    public void setJgmc(String jgmc) {
        this.jgmc = jgmc;
    }

   public String getXm() {
        return xm;
    }

    public void setXm(String xm) {
        this.xm = xm;
    }

    public String getOldDlmm() {
        return oldDlmm;
    }

    public void setOldDlmm(String oldDlmm) {
        this.oldDlmm = oldDlmm;
    }


    public List<Role> getRoles() {
        return roles;
    }

    public void setRoles(List<Role> roles) {
        this.roles = roles;
    }
    public List<Function> getFunctions() {
        return functions;
    }

    public void setFunctions(List<Function> functions) {
        this.functions = functions;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public int getJgbm() {
        return jgbm;
    }

    public void setJgbm(int jgbm) {
        this.jgbm = jgbm;
    }

    public String getDepartmentPath() {
        return departmentPath;
    }

    public void setDepartmentPath(String departmentPath) {
        this.departmentPath = departmentPath;
    }

    public String getSj() {
        return sj;
    }

    public void setSj(String sj) {
        this.sj = sj;
    }
}